
CURDIR := $(shell pwd)
LIBDIR := $(CURDIR)/../linux

LIB += -L$(LIBDIR)/lib64 -luv
INC += -I$(LIBDIR)/include

all:
	export LD_LIBRARY_PATH=$(LIBDIR)/lib64
	gcc hello.c $(INC) $(LIB) -o hello -Wall
	gcc idle.c $(INC) $(LIB) -o idle -Wall
	gcc idle_compute.c $(INC) $(LIB) -o idle_compute -Wall
	gcc fs_cat.c $(INC) $(LIB) -o fs_cat -Wall
	gcc prep_idle.c $(INC) $(LIB) -o prep_idle -Wall
	gcc pipe_tee.c $(INC) $(LIB) -o pipe_tee -Wall
	gcc fs_event_onchange.c $(INC) $(LIB) -o fs_event_onchange -Wall
	gcc ref_timer.c $(INC) $(LIB) -o ref_timer -Wall
	gcc thread.c $(INC) $(LIB) -o thread -Wall
	gcc locks.c $(INC) $(LIB) -o locks -Wall
	gcc interfaces.c $(INC) $(LIB) -o interfaces -Wall
	gcc echo_tcp_client.c $(INC) $(LIB) -o echo_tcp_client -Wall
	gcc echo_tcp_server.c $(INC) $(LIB) -o echo_tcp_server -Wall
	gcc udp_dhcp.c $(INC) $(LIB) -o udp_dhcp -Wall
	gcc dns.c $(INC) $(LIB) -o dns -Wall
	gcc queue_cancel.c $(INC) $(LIB) -o queue_cancel -Wall
	gcc queue_work.c $(INC) $(LIB) -o queue_work -Wall
	gcc async_progress.c $(INC) $(LIB) -o async_progress -Wall
	gcc process.c $(INC) $(LIB) -o process -Wall
	gcc process_detach.c $(INC) $(LIB) -o process_detach -Wall
	gcc process_signal.c $(INC) $(LIB) -o process_signal -Wall

clean:
	rm hello idle idle_compute fs_cat prep_idle pipe_tee fs_event_onchange ref_timer thread locks interfaces echo_tcp_client echo_tcp_server udp_dhcp dns queue_cancel queue_work async_progress process process_detach process_signal
